import request from '../request'

// 用户管理
export function getUserList(params) {
  return request({
    url: '/api/v1/Permission/User/List',
    method: 'get',
    params
  })
}

// 角色管理
export function getRoleList(params) {
  return request({
    url: '/api/v1/Permission/Role/List',
    method: 'get',
    params
  })
}

// 菜单管理
export function getMenuList(params) {
  return request({
    url: '/api/v1/Permission/Menu/List',
    method: 'get',
    params
  })
}

export function addMenu(data) {
  return request({
    url: '/api/v1/Permission/Menu/Add',
    method: 'post',
    data
  })
}

export function updateMenu(data) {
  return request({
    url: '/api/v1/Permission/Menu/Update',
    method: 'put',
    data
  })
}

export function deleteMenu(id) {
  return request({
    url: `/api/v1/Permission/Menu/Delete/${id}`,
    method: 'delete'
  })
}

// 权限管理
export function getAuthList(params) {
  return request({
    url: '/api/v1/Permission/Auth/List',
    method: 'get',
    params
  })
}

export function assignAuth(data) {
  return request({
    url: '/api/v1/Permission/Auth/Assign',
    method: 'post',
    data
  })
} 